
export const BASE_URL = "https://mock.ikmoons.com/mock/11/applet";

export const CONCAT_IMG_URL = (url: string) => {
  return `https://chor-young-1300991683.cos.ap-nanjing.myqcloud.com/files${url}`;
};
export const CONCAT_CDN_IMAGE_ORIGIN = (url: string) => {
  return `https://chor-young-1300991683.cos.ap-nanjing.myqcloud.com/ctyj_applets/${url}`;
};

export const REG_CDN_IMAGE_ORIGIN = (url: string) => {
  const reg = /^http.*/;
  if (reg.test(url)) {
    return url;
  } else {
    return CONCAT_CDN_IMAGE_ORIGIN(url);
  }
};

export const REG_CDN_FILE_ORIGIN = (url: string) => {
  const reg = /^http.*/;
  if (reg.test(url)) {
    return url;
  } else {
    return CONCAT_IMG_URL(url);
  }
};

export const REG_CDN_VIDEO_ORIGIN = (url: string) => {
  const reg = /^http.*/;
  if (reg.test(url)) {
    return url;
  } else {
    return CONCAT_IMG_URL(url);
  }
};


export const testImageUrl = 'https://yanxuan.nosdn.127.net/14918201901050274.jpg'
export const testVideoUrl = 'https://chor-young-1300991683.cos.ap-nanjing.myqcloud.com/backend/2021/11/24/1637742519154.video/mp4'

export const generateTestImage = (name: string | number) => {
  return require(`@/assets/test/${name}.png`)
}

export const office365 = (url: string) => {
  return `https://ow365.cn/?i=28595&furl=${url}`
}